<?php

namespace App\Models\MainDB;

use Illuminate\Database\Eloquent\Model;

class GameSugarInfo extends Model
{
    protected $connection = 'mysql';

    protected $table = 'ln_game_sugar_info';

    public $timestamps = false;

    public function getListByCondition($condition, $field = '*', $limit = 10)
    {
        return $this->selectRaw($field)
            ->where($condition)
            ->orderBy('id','desc')
            ->paginate($limit)
            ->toArray();
    }

    public function getDetailByCondition($condition, $field = '*')
    {
        return $this->selectRaw($field)
            ->where($condition)
            ->first();
    }
}
